package io.github.andeibuite.clip.core

import io.github.nishikigii.criterionkt.basic.version.Edition
import io.github.nishikigii.criterionkt.network.local.Pull
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import org.slf4j.LoggerFactory

@Edition(2024u)
data class Minecraft (

	val root: String,

	val version: String,

	val assets: String = "$root/assets",

	val libraries: String = "$root/libraries",

	val versions: String = "$root/versions/$version",

	val logs: String = "$versions/saves",

	val resourcePacks: String = "$versions/resourcepacks",

	val servers: String = "$versions/servers.dat",

	val options: String = "$versions/options.txt",

): Pull
{

	// logger.
	private val logger = LoggerFactory.getLogger(this::class.java)

	/**
	 * download tasks tracker.
	 */
	private val track = object: CoroutineScope
	{
		override val coroutineContext = Dispatchers.IO
	}

	/**
	 * public download tasks tracker getter.
	 */
	override fun track() = track


	/**
	 * pull files of minecraft instance from the internet.
	 * you could also get the progress tracker with track() later.
	 * @return download tasks tracker.
	 */
	override fun pull() = track.apply {
		logger.info("minecraft pulling task started")
		logger.info("try to save account info")
	}


}
